package com.yanqu.road.server.cmd.player;

import com.yanqu.road.pb.activity.BusinessReunionProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameProtocol;
import io.netty.channel.ChannelHandlerContext;

/**
 * @author ：zfr
 * @date ：2022/4/19 17:36
 */
@Cmd(code = CrossProtocol.C_CROSS_SYNC_TO_BIND_PLAYER_ADD_VIP_EXP, desc = "同步增加的vip经验")
public class CrossSyncBindPlayerAddVipExpCmd implements Command {
    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        BusinessReunionProto.SyncBindPlayerAddVipExpMsg syncMsg = BusinessReunionProto.SyncBindPlayerAddVipExpMsg.parseFrom(packet.getBytes());
        YanQuMessage message = YanQuMessageUtils.buildMessage(GameProtocol.S_CROSS_SYNC_BIND_ADD_VIP_EXP, syncMsg);
        MessageHelper.sendPacket(syncMsg.getSyncToServerId(), 0, message);
    }
}
